package com.liukai.bishe.model;

import com.liukai.bishe.model.doman.transaction.Transaction;
import com.liukai.bishe.model.doman.transaction.TransactionMessageList;
import com.liukai.bishe.model.doman.transaction.TransactionRankList;
import com.liukai.bishe.model.doman.transaction.TransactionTotal;
import com.liukai.bishe.model.doman.transaction.TransactionUseTime;
import com.liukai.bishe.model.doman.transaction.TransactionUserTimeMessageList;
import com.liukai.bishe.model.doman.user.UserMessage;

import java.util.List;

import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Query;

public interface API {

    @GET("/user/login")
    Call<UserMessage> login(@Query("user") String user);

    @POST("/user/register")
    Call<UserMessage> register(@Query("user") String user);

    @PUT("/user/update")
    Call<UserMessage> update(@Query("user") String user);

    @POST("/transaction/addTransaction")
    Call<TransactionMessageList> addTransaction(@Query("transaction") String transaction,
                                                @Query("username") String username);
    @POST("/transaction/findTransactionByUserName")
    Call<TransactionMessageList> findTransactionByUserName(@Query("username") String username);

//    @POST("/transactionUserTime/downOnceTransaction")
//    Call<ResponseBody> downTransaction(@Body TransactionUseTime transactionUseTime);

    @POST("/transactionUserTime/downOnceTransaction")
    Call<List<TransactionUseTime>> downTransaction(@Body TransactionUseTime transactionUseTime);

    @POST("/transactionUserTime/findTransactionUserTimeByUserName")
    Call<List<TransactionUseTime>> findTransactionUserTimeByUserName(@Query("username") String username);

    @POST("/transactionTotal/findTransactionTotalByUserName")
    Call<List<TransactionTotal>> findTransactionTotalByUserName(@Query("username") String username);

    @DELETE("/transaction/deleteTransactionById")
    Call<List<Transaction>> deleteTransactionById(@Query("id") String id,@Query("username") String username);

    @PUT("/transaction/updateTransactionById")
    Call<List<Transaction>> updateTransactionById(@Body Transaction transaction);

    @GET("/transaction/getRankList")
    Call<List<TransactionRankList>> getRankList();

}
